package com.cloudlead.customerAction.action;

import com.cloudlead.common.lang.annotation.Label;
import com.cloudlead.common.lang.persistence.EasyuiGridData;
import com.cloudlead.common.worker.action.impl.AbstractActionFactory;
import com.cloudlead.common.worker.annotation.Action;
import com.cloudlead.common.worker.annotation.Order;
import com.cloudlead.customerAction.BusinessModules;
import com.cloudlead.customerAction.service.OrderTrackingSer;
import com.cloudlead.customerService.OrderTrackingService;
import com.cloudlead.customerService.vo.ContainerCountVo;
import com.cloudlead.customerService.vo.CustmoerOrderVo;
import com.cloudlead.customerService.vo.GPSVo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;

import javax.validation.constraints.NotNull;
import java.util.List;

/**
 * Created by 20150817 on 2015/8/31.
 */
@Controller
public class OderTrackingActionFactory extends AbstractActionFactory implements OrderTrackingService{
    public OderTrackingActionFactory() {
        super(BusinessModules.OrderTracking);
    }
    @Autowired
    OrderTrackingSer orderTrackingSer;

    @Override
    @Action
    @Order(3)
    @Label("订单信息")
    public CustmoerOrderVo getCustomerOrder(@NotNull @Label("运单号/订单号/箱号")String trackingNo) {
        return orderTrackingSer.findCustomerOrderByTrackingNo(trackingNo);
    }

    @Override
    @Action
    @Order(3)
    @Label("箱信息")
    public   List<ContainerCountVo> getContainerCount( @NotNull @Label("运单号/订单号/箱号")String trackingNo) {
        return orderTrackingSer.findContainerByOrder(trackingNo);

    }

    @Override
    @Action
    @Order(3)
    @Label("获取gos")
    public GPSVo getGPS(@NotNull @Label("车牌号")String carName,@NotNull @Label("gps名称")String gpsNmae) {
        return orderTrackingSer.findGPSByCarName(carName,gpsNmae);
    }


}
